/**
 * Copyright (c) 2011-2012
 * OmniCore CodeGuide
 */
package de.tum.in.oose.bumpers.cars.instruments.us;

import de.tum.in.oose.bumpers.cars.UserCar;
import de.tum.in.oose.bumpers.cars.instruments.Body;
import de.tum.in.oose.bumpers.cars.instruments.GPS;
import de.tum.in.oose.bumpers.cars.instruments.InstrumentFactory;
import de.tum.in.oose.bumpers.cars.instruments.RotationsPerSecond;
import de.tum.in.oose.bumpers.cars.instruments.SpeedController;
import de.tum.in.oose.bumpers.cars.instruments.Speedometer;

/**
 * The US Factory for creating instruments.
 */
public final class USFactory extends InstrumentFactory {
	
	private static USFactory instance;
	
	private USFactory(){
		//singleton constructor
	}
	
	/**
	 * @return The singleton factory.
	 */
	public static InstrumentFactory getInstance(){
		if(instance == null){
			instance = new USFactory();
		}
		return instance;
	}
	
	/**
	 * @param theCar the user car
	 * @return The created rps object 
	 */
	public RotationsPerSecond createRotationsPerSecond(UserCar theCar) {
		return new USRotationsPerSecond(theCar);
	}

	/**
	 * @param theCar the user car
	 * @return The created speedcontroller object 
	 */
	public SpeedController createSpeedController(UserCar theCar) {
		return new USSpeedController(theCar);
	}
	
	/**
	 * @param theCar the user car
	 * @return The created speedometer object 
	 */
	public Speedometer createSpeedometer(UserCar theCar) {
		return new USSpeedometer(theCar);
	}
	
	/**
	 * @param theCar the user car
	 * @return The created bodyview object 
	 */
	public Body createBodyView(UserCar theCar) {
		return new USBody(theCar);
	}
	
	/**
	 * @param theCar the user car
	 * @return The created gps object 
	 */
	public GPS createGPS(UserCar theCar) {
		return new USGPS(theCar);
	}
}

